
import cv2
import numpy

face_cascade = cv2.CascadeClassifier("/home/jasonleaster/opencv-3.0.0/data/haarcascades/haarcascade_frontalface_default.xml")

#image = cv2.imread("/home/jasonleaster/IMG_20150817_184743.jpg")
image = cv2.imread("/home/jasonleaster/positive8.jpg")

dst = cv2.resize(image, (300, 300), interpolation = cv2.INTER_CUBIC)

gray = cv2.cvtColor(dst, cv2.COLOR_BGR2GRAY)

faces = face_cascade.detectMultiScale(gray, 1.2, 5)

for (x, y, w, h) in faces:
    cv2.rectangle(dst, (x, y), (x+w, y+h), (0, 255, 0), 2)

cv2.imshow('YCM', dst)
cv2.waitKey(0)
cv2.destroyAllWindows()